﻿<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
      <title>ConcurrentOneToManyQueue&lt;TKey, TValue&gt; 类
 | Fantasy.Net API Reference </title>
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <meta name="title" content="ConcurrentOneToManyQueue&lt;TKey, TValue&gt; 类
 | Fantasy.Net API Reference ">
      
      <link rel="icon" href="../favicon.ico">
      <link rel="stylesheet" href="../public/docfx.min.css">
      <link rel="stylesheet" href="../public/main.css">
      <meta name="docfx:navrel" content="../toc.html">
      <meta name="docfx:tocrel" content="toc.html">
      
      <meta name="docfx:rel" content="../">
      
      
      
  </head>

  <script type="module">
    import options from './../public/main.js'
    import { init } from './../public/docfx.min.js'
    init(options)
  </script>

  <script>
    const theme = localStorage.getItem('theme') || 'auto'
    document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
  </script>

  <body class="tex2jax_ignore" data-layout="" data-yaml-mime="ManagedReference">
    <header class="bg-body border-bottom">
      <nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
        <div class="container-xxl flex-nowrap">
          <a class="navbar-brand" href="../index.html">
            <img id="logo" class="svg" src="../logo.svg" alt="Fantasy.Net">
            Fantasy.Net
          </a>
          <button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
            <i class="bi bi-three-dots"></i>
          </button>
          <div class="collapse navbar-collapse" id="navpanel">
            <div id="navbar">
              <form class="search" role="search" id="search">
                <i class="bi bi-search"></i>
                <input class="form-control" id="search-query" type="search" disabled="" placeholder="搜索" autocomplete="off" aria-label="Search">
              </form>
            </div>
          </div>
        </div>
      </nav>
    </header>

    <main class="container-xxl">
      <div class="toc-offcanvas">
        <div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
          <div class="offcanvas-header">
            <h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
            <button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
          </div>
          <div class="offcanvas-body">
            <nav class="toc" id="toc"></nav>
          </div>
        </div>
      </div>

      <div class="content">
        <div class="actionbar">
          <button class="btn btn-lg border-0 d-md-none" style="margin-top: -.65em; margin-left: -.8em" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
            <i class="bi bi-list"></i>
          </button>

          <nav id="breadcrumb"></nav>
        </div>

        <article data-uid="Fantasy.ConcurrentOneToManyQueue`2">



  <h1 id="Fantasy_ConcurrentOneToManyQueue_2" data-uid="Fantasy.ConcurrentOneToManyQueue`2" class="text-break">
    ConcurrentOneToManyQueue&lt;TKey, TValue&gt; 类
  
  </h1>

  <div class="facts text-secondary">
    <dl><dt>命名空间</dt><dd><a class="xref" href="Fantasy.html">Fantasy</a></dd></dl>
  <dl><dt>程序集</dt><dd>Fantasy.Net.dll</dd></dl>
  </div>

  <div class="markdown summary"><p>表示一个并发的一对多队列，用于维护具有相同键的多个值的关联关系。</p>
</div>
  <div class="markdown conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class ConcurrentOneToManyQueue&lt;TKey, TValue&gt; : ConcurrentDictionary&lt;TKey, Queue&lt;TValue&gt;&gt;, IDictionary&lt;TKey, Queue&lt;TValue&gt;&gt;, ICollection&lt;KeyValuePair&lt;TKey, Queue&lt;TValue&gt;&gt;&gt;, IDictionary, ICollection, IReadOnlyDictionary&lt;TKey, Queue&lt;TValue&gt;&gt;, IReadOnlyCollection&lt;KeyValuePair&lt;TKey, Queue&lt;TValue&gt;&gt;&gt;, IEnumerable&lt;KeyValuePair&lt;TKey, Queue&lt;TValue&gt;&gt;&gt;, IEnumerable where TKey : notnull</code></pre>
  </div>



  <h4 class="section">类型参数</h4>
  <dl class="parameters">
    <dt><code>TKey</code></dt>
    <dd><p>关键字的类型，不能为空。</p>
</dd>
    <dt><code>TValue</code></dt>
    <dd><p>值的类型。</p>
</dd>
  </dl>

  <dl class="typelist inheritance">
    <dt>继承</dt>
    <dd>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2">ConcurrentDictionary</a>&lt;TKey, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.queue-1">Queue</a>&lt;TValue&gt;&gt;</div>
      <div><span class="xref">ConcurrentOneToManyQueue&lt;TKey, TValue&gt;</span></div>
    </dd>
  </dl>

  <dl class="typelist implements">
    <dt>实现</dt>
    <dd>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.idictionary-2">IDictionary</a>&lt;TKey, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.queue-1">Queue</a>&lt;TValue&gt;&gt;</div>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.icollection-1">ICollection</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.keyvaluepair-2">KeyValuePair</a>&lt;TKey, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.queue-1">Queue</a>&lt;TValue&gt;&gt;&gt;</div>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.idictionary">IDictionary</a></div>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.icollection">ICollection</a></div>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlydictionary-2">IReadOnlyDictionary</a>&lt;TKey, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.queue-1">Queue</a>&lt;TValue&gt;&gt;</div>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlycollection-1">IReadOnlyCollection</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.keyvaluepair-2">KeyValuePair</a>&lt;TKey, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.queue-1">Queue</a>&lt;TValue&gt;&gt;&gt;</div>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.keyvaluepair-2">KeyValuePair</a>&lt;TKey, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.queue-1">Queue</a>&lt;TValue&gt;&gt;&gt;</div>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.ienumerable">IEnumerable</a></div>
    </dd>
  </dl>

  <dl class="typelist derived">
    <dt>Derived</dt>
    <dd>
      <div><a class="xref" href="Fantasy.ConcurrentOneToManyQueuePool-2.html">ConcurrentOneToManyQueuePool&lt;TKey, TValue&gt;</a></div>
    </dd>
  </dl>

  <dl class="typelist derived">
    <dt>继承成员</dt>
    <dd>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2.tryadd">ConcurrentDictionary&lt;TKey, Queue&lt;TValue&gt;&gt;.TryAdd(TKey, Queue&lt;TValue&gt;)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2.containskey">ConcurrentDictionary&lt;TKey, Queue&lt;TValue&gt;&gt;.ContainsKey(TKey)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2.tryremove#system-collections-concurrent-concurrentdictionary-2-tryremove(-0-1@)">ConcurrentDictionary&lt;TKey, Queue&lt;TValue&gt;&gt;.TryRemove(TKey, out Queue&lt;TValue&gt;)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2.tryremove#system-collections-concurrent-concurrentdictionary-2-tryremove(system-collections-generic-keyvaluepair((-0-1)))">ConcurrentDictionary&lt;TKey, Queue&lt;TValue&gt;&gt;.TryRemove(KeyValuePair&lt;TKey, Queue&lt;TValue&gt;&gt;)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2.trygetvalue">ConcurrentDictionary&lt;TKey, Queue&lt;TValue&gt;&gt;.TryGetValue(TKey, out Queue&lt;TValue&gt;)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2.tryupdate">ConcurrentDictionary&lt;TKey, Queue&lt;TValue&gt;&gt;.TryUpdate(TKey, Queue&lt;TValue&gt;, Queue&lt;TValue&gt;)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2.clear">ConcurrentDictionary&lt;TKey, Queue&lt;TValue&gt;&gt;.Clear()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2.toarray">ConcurrentDictionary&lt;TKey, Queue&lt;TValue&gt;&gt;.ToArray()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2.getenumerator">ConcurrentDictionary&lt;TKey, Queue&lt;TValue&gt;&gt;.GetEnumerator()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2.getoradd#system-collections-concurrent-concurrentdictionary-2-getoradd(-0-system-func((-0-1)))">ConcurrentDictionary&lt;TKey, Queue&lt;TValue&gt;&gt;.GetOrAdd(TKey, Func&lt;TKey, Queue&lt;TValue&gt;&gt;)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2.getoradd#system-collections-concurrent-concurrentdictionary-2-getoradd-1(-0-system-func((-0-0-1))-0)">ConcurrentDictionary&lt;TKey, Queue&lt;TValue&gt;&gt;.GetOrAdd&lt;TArg&gt;(TKey, Func&lt;TKey, TArg, Queue&lt;TValue&gt;&gt;, TArg)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2.getoradd#system-collections-concurrent-concurrentdictionary-2-getoradd(-0-1)">ConcurrentDictionary&lt;TKey, Queue&lt;TValue&gt;&gt;.GetOrAdd(TKey, Queue&lt;TValue&gt;)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2.addorupdate#system-collections-concurrent-concurrentdictionary-2-addorupdate-1(-0-system-func((-0-0-1))-system-func((-0-1-0-1))-0)">ConcurrentDictionary&lt;TKey, Queue&lt;TValue&gt;&gt;.AddOrUpdate&lt;TArg&gt;(TKey, Func&lt;TKey, TArg, Queue&lt;TValue&gt;&gt;, Func&lt;TKey, Queue&lt;TValue&gt;, TArg, Queue&lt;TValue&gt;&gt;, TArg)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2.addorupdate#system-collections-concurrent-concurrentdictionary-2-addorupdate(-0-system-func((-0-1))-system-func((-0-1-1)))">ConcurrentDictionary&lt;TKey, Queue&lt;TValue&gt;&gt;.AddOrUpdate(TKey, Func&lt;TKey, Queue&lt;TValue&gt;&gt;, Func&lt;TKey, Queue&lt;TValue&gt;, Queue&lt;TValue&gt;&gt;)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2.addorupdate#system-collections-concurrent-concurrentdictionary-2-addorupdate(-0-1-system-func((-0-1-1)))">ConcurrentDictionary&lt;TKey, Queue&lt;TValue&gt;&gt;.AddOrUpdate(TKey, Queue&lt;TValue&gt;, Func&lt;TKey, Queue&lt;TValue&gt;, Queue&lt;TValue&gt;&gt;)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2.item">ConcurrentDictionary&lt;TKey, Queue&lt;TValue&gt;&gt;.this[TKey]</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2.comparer">ConcurrentDictionary&lt;TKey, Queue&lt;TValue&gt;&gt;.Comparer</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2.count">ConcurrentDictionary&lt;TKey, Queue&lt;TValue&gt;&gt;.Count</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2.isempty">ConcurrentDictionary&lt;TKey, Queue&lt;TValue&gt;&gt;.IsEmpty</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2.keys">ConcurrentDictionary&lt;TKey, Queue&lt;TValue&gt;&gt;.Keys</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2.values">ConcurrentDictionary&lt;TKey, Queue&lt;TValue&gt;&gt;.Values</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object, object)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object, object)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a>
    </div>
  </dd></dl>

  <dl class="typelist extensionMethods">
    <dt>扩展方法</dt>
    <dd>
  <div>
      <a class="xref" href="Fantasy.JsonHelper.html#Fantasy_JsonHelper_ToJson__1___0_">JsonHelper.ToJson&lt;T&gt;(T)</a>
  </div>
  <div>
      <a class="xref" href="Fantasy.DictionaryExtensions.html#Fantasy_DictionaryExtensions_TryRemove__2_System_Collections_Generic_IDictionary___0___1____0___1__">DictionaryExtensions.TryRemove&lt;T, TV&gt;(IDictionary&lt;T, TV&gt;, T, out TV)</a>
  </div>
  </dd></dl>





  <h2 class="section" id="constructors">构造函数
</h2>


  <a id="Fantasy_ConcurrentOneToManyQueue_2__ctor_" data-uid="Fantasy.ConcurrentOneToManyQueue`2.#ctor*"></a>

  <h3 id="Fantasy_ConcurrentOneToManyQueue_2__ctor_System_Int32_" data-uid="Fantasy.ConcurrentOneToManyQueue`2.#ctor(System.Int32)">
  ConcurrentOneToManyQueue(int)
  
  </h3>

  <div class="markdown level1 summary"><p>设置最大缓存数量</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public ConcurrentOneToManyQueue(int recyclingLimit = 0)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>recyclingLimit</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>1:防止数据量过大、所以超过recyclingLimit的数据还是走GC.
2:设置成0不控制数量，全部缓存</p>
</dd>
  </dl>












  <h2 class="section" id="methods">方法
</h2>


  <a id="Fantasy_ConcurrentOneToManyQueue_2_Clear_" data-uid="Fantasy.ConcurrentOneToManyQueue`2.Clear*"></a>

  <h3 id="Fantasy_ConcurrentOneToManyQueue_2_Clear" data-uid="Fantasy.ConcurrentOneToManyQueue`2.Clear">
  Clear()
  
  </h3>

  <div class="markdown level1 summary"><p>清空当前类的数据，包括从基类继承的键值对字典中的数据以及自定义的队列池。</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">protected void Clear()</code></pre>
  </div>













  <a id="Fantasy_ConcurrentOneToManyQueue_2_Contains_" data-uid="Fantasy.ConcurrentOneToManyQueue`2.Contains*"></a>

  <h3 id="Fantasy_ConcurrentOneToManyQueue_2_Contains__0__1_" data-uid="Fantasy.ConcurrentOneToManyQueue`2.Contains(`0,`1)">
  Contains(TKey, TValue)
  
  </h3>

  <div class="markdown level1 summary"><p>判断指定键的队列是否包含指定值。</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public bool Contains(TKey key, TValue value)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>key</code> <span class="xref">TKey</span></dt>
    <dd><p>要搜索的键。</p>
</dd>
    <dt><code>value</code> <span class="xref">TValue</span></dt>
    <dd><p>要搜索的值。</p>
</dd>
  </dl>

  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
    <dd><p>如果队列包含值，则为 true；否则为 false。</p>
</dd>
  </dl>











  <a id="Fantasy_ConcurrentOneToManyQueue_2_Dequeue_" data-uid="Fantasy.ConcurrentOneToManyQueue`2.Dequeue*"></a>

  <h3 id="Fantasy_ConcurrentOneToManyQueue_2_Dequeue__0_" data-uid="Fantasy.ConcurrentOneToManyQueue`2.Dequeue(`0)">
  Dequeue(TKey)
  
  </h3>

  <div class="markdown level1 summary"><p>从指定键的队列中出队并返回一个值。</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public TValue Dequeue(TKey key)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>key</code> <span class="xref">TKey</span></dt>
    <dd><p>要出队的键。</p>
</dd>
  </dl>

  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><span class="xref">TValue</span></dt>
    <dd><p>出队的值，如果队列为空则为默认值。</p>
</dd>
  </dl>











  <a id="Fantasy_ConcurrentOneToManyQueue_2_Enqueue_" data-uid="Fantasy.ConcurrentOneToManyQueue`2.Enqueue*"></a>

  <h3 id="Fantasy_ConcurrentOneToManyQueue_2_Enqueue__0__1_" data-uid="Fantasy.ConcurrentOneToManyQueue`2.Enqueue(`0,`1)">
  Enqueue(TKey, TValue)
  
  </h3>

  <div class="markdown level1 summary"><p>向指定键的队列中添加一个值。</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public void Enqueue(TKey key, TValue value)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>key</code> <span class="xref">TKey</span></dt>
    <dd><p>要添加值的键。</p>
</dd>
    <dt><code>value</code> <span class="xref">TValue</span></dt>
    <dd><p>要添加的值。</p>
</dd>
  </dl>












  <a id="Fantasy_ConcurrentOneToManyQueue_2_RemoveKey_" data-uid="Fantasy.ConcurrentOneToManyQueue`2.RemoveKey*"></a>

  <h3 id="Fantasy_ConcurrentOneToManyQueue_2_RemoveKey__0_" data-uid="Fantasy.ConcurrentOneToManyQueue`2.RemoveKey(`0)">
  RemoveKey(TKey)
  
  </h3>

  <div class="markdown level1 summary"><p>从字典中移除指定键以及其关联的队列。</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public void RemoveKey(TKey key)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>key</code> <span class="xref">TKey</span></dt>
    <dd><p>要移除的键。</p>
</dd>
  </dl>












  <a id="Fantasy_ConcurrentOneToManyQueue_2_TryDequeue_" data-uid="Fantasy.ConcurrentOneToManyQueue`2.TryDequeue*"></a>

  <h3 id="Fantasy_ConcurrentOneToManyQueue_2_TryDequeue__0__1__" data-uid="Fantasy.ConcurrentOneToManyQueue`2.TryDequeue(`0,`1@)">
  TryDequeue(TKey, out TValue)
  
  </h3>

  <div class="markdown level1 summary"><p>尝试从指定键的队列中出队一个值。</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public bool TryDequeue(TKey key, out TValue value)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>key</code> <span class="xref">TKey</span></dt>
    <dd><p>要出队的键。</p>
</dd>
    <dt><code>value</code> <span class="xref">TValue</span></dt>
    <dd><p>出队的值，如果队列为空则为默认值。</p>
</dd>
  </dl>

  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
    <dd><p>如果成功出队，则为 true；否则为 false。</p>
</dd>
  </dl>












</article>


        
      </div>

      <div class="affix">
        <nav id="affix"></nav>
      </div>
    </main>

    <div class="container-xxl search-results" id="search-results"></div>

    <footer class="border-top">
      <div class="container-xxl">
        <div class="flex-fill">
          <span>Made with <a href="https://dotnet.github.io/docfx">docfx</a></span>
        </div>
      </div>
    </footer>
  </body>
</html>